﻿<%@ Page Language="C#" MasterPageFile="~/Member/MemMaster.master" AutoEventWireup="true"
    CodeBehind="EmpList.aspx.cs" Inherits="PayRoller.Member.EmpList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="620" align="center" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="100" style="height: 24px">
                            Employee ID:
                        </td>
                        <td style="height: 24px">
                            <asp:TextBox ID="txtOrgEmpSid" runat="server" Width="160px"></asp:TextBox>
                        </td>
                        <td width="110" style="height: 24px">
                            Employee Name:
                        </td>
                        <td style="width: 13px; height: 24px" align="left">
                            <asp:TextBox ID="txtEmpName" runat="server" Width="160px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 22px">
                            Our Reference:
                        </td>
                        <td style="height: 22px">
                            <asp:TextBox ID="txtSid" runat="server" Width="160px"></asp:TextBox>
                        </td>
                        <td colspan="2" style="height: 22px" align="center">
                            <asp:Button ID="bnSearch" runat="server" Text="Search" OnClick="bnSearch_Click" CssClass="submitBtn" />
                        </td>
                        <td style="height: 22px">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="height: 16px">
                <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#cccccc">
                    <tr bgcolor="#cccccc">
                        <td height="22">
                            <strong>Employee Name</strong>
                        </td>
                        <td>
                            <strong>Our Ref</strong>
                        </td>
                        <td>
                            <strong>Your Ref</strong>
                        </td>
                        <td>
                            <strong>Status</strong>
                        </td>
                        <td>
                            <strong>Next Payment</strong>
                        </td>
                        <td>
                            <strong>Payment Date</strong>
                        </td>
                        <td>
                            <strong>Detail</strong>
                        </td>
                        <td>
                            <strong>Delete</strong>
                        </td>
                    </tr>
                    <% 
                        for (int i = 0; i < dtEmpList.Rows.Count; i++)
                        {
                            string EmpName = dtEmpList.Rows[i]["EmpName"].ToString();
                            string OrgEmpSid = dtEmpList.Rows[i]["OrgEmpSid"].ToString();
                            string Sid = dtEmpList.Rows[i]["Sid"].ToString();
                            int IsValid = Convert.ToInt32( dtEmpList.Rows[i]["IsValid"]);
                            string statusText = HySoft.Cash.Business.TempinfoBN.GetEmpStatusText(IsValid);
                            
                            //if (IsValid.Trim().Equals("1"))
                            //    IsValid = "Active";
                            //else
                            //    IsValid = "Terminated";
                            string NextPayday = dtEmpList.Rows[i]["NextPayday"].ToString();
                            if (string.IsNullOrEmpty(NextPayday) == false)
                            {
                               NextPayday= Huayou.Utils.DateUtils.DateFormatWithCulture(NextPayday,HySoft.Cash.AppSettings.CurrentCulture);
                            }
                            string NetPayment = GetSumPaymentByEmp(Convert.ToInt32(Sid));    
                    %>
                    <tr bgcolor="#FFFFFF">
                        <td height="22">
                            <%=EmpName%>
                        </td>
                        <td>
                            <%=Sid%>
                        </td>
                        <td>
                            <%=OrgEmpSid%>
                        </td>
                        <td>
                            <%=statusText%>
                        </td>
                        <td>
                            <%=NetPayment%>
                        </td>
                        <td>
                            <%=NextPayday%>
                        </td>
                        <td>
                            <div align="center">
                                <a href="EmpDetail.aspx?Sid=<%=Sid%>">Detail</a></div>
                        </td>
                        <td>
                            <div align="center">
                                <a href="EmpDel.aspx?EmpSid=<%=Sid%>" onclick="return confirm('&#30830;&#23454;&#35201;&#21024;&#38500;&#35813;&#21592;&#24037;&#20449;&#24687;?');">Delete</a></div>
                        </td>
                    </tr>
                    <%} %>
                </table>
            </td>
        </tr>
        <tr>
            <td height="24" align="center">
                <a href="#" onclick="history.go(-1);">Return</a>
            </td>
        </tr>
    </table>
</asp:Content>
